#include "common.h"

int main(void)
{
	IAP_Init();
	SerialPutString("\r\n======================================================================");
	SerialPutString("\r\n=              (C) COPYRIGHT 2024 LinkLiao(linkliao610@163.com)      =");
	SerialPutString("\r\n=                                                                    =");
	SerialPutString("\r\n=     In-Application Programming Application  (Version 0.1.0)        =");
	SerialPutString("\r\n=                                                                    =");
	SerialPutString("\r\n======================================================================");
	SerialPutString("\r\n\r\n");
	Main_Menu();
	while(1);
}



void IAP_Init(void)
{
	uint32_t hclk_uartx;
	rcu_periph_clock_enable(RCU_CLKON_UARTX); 
	rcu_periph_clock_enable(RCU_CLKON_GPIO0); 
	gpio_pin_af_set(UARTX_RXD_GPIO0_00);
	gpio_pin_af_set(UARTX_TXD_GPIO0_01);
	UARTX_SetTxEn();
	UARTX_SetRxEn();
	hclk_uartx = rcu_clock_freq_get(CK_AHB);
	UARTX_SetBaudRate(hclk_uartx, 115200);
	SFC_CFG |= SFC_CFG_SFC_EN_Msk;
}

